Entry: Fix unset icon tooltip hiding Entry tooltip
authorDaniel Boles <dboles@src.gnome.org>
Tue, 1 Aug 2017 09:09:01 +0000 (10:09 +0100)
committerDaniel Boles <dboles@src.gnome.org>
Tue, 1 Aug 2017 17:13:11 +0000 (18:13 +0100)
commit44c4faeed06aca1711b45089ec0cae55c49aa11d
tree75a6a16f10a751bde1028afc5b8af234c70dcfa9
parentb3a60675413300b2268ecba6232b98b2cc96c433
Entry: Fix unset icon tooltip hiding Entry tooltip

Our ::query-tooltip handler first checks whether the pointer is over any
of the icons, returning their tooltip if so, and if not chains up to
Widget::query-tooltip in order to show the text for the widget overall.

But ensure_has_tooltip(), which exists to update :has-tooltip based on
whether ::query-tooltip is needed, only set :has-tooltip to TRUE if any
icon had a tooltip, without caring whether the widget as a whole does.

That is asymmetrical and meant that if the Entry had a tooltip, but
subsequently all icons had their tooltips unset, :has-tooltip would be
set to FALSE, and hence the tooltip for the widget would become lost.

The fix is to set :has-tooltip to TRUE if the widget has a tooltip of
its own, and we only need to check the icons if that is not the case.

https://bugzilla.gnome.org/show_bug.cgi?id=785672
gtk/gtkentry.c